# Contributor: Will Sinatra <wpsinatra@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=pyplucker
pkgver=3.7
pkgrel=0
pkgdesc="Web and document parser, converter and scraper for Plucker, the Palm OS app"
url="https://github.com/lxmx/PyPlucker"
arch="noarch"
license="GPL-2.0"
depends="python3 py3-pillow"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc $pkgname-doc"
source="https://github.com/lxmx/PyPlucker/archive/$pkgver/PyPlucker-$pkgver.tar.gz
	pluck.sh
	home.html
	pluckerrc
	decode_python3.patch
	correct_gettext.patch"
builddir="$srcdir/PyPlucker-$pkgver"
options="!check" #no checks

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname/examples

	install -Dm644 "$srcdir"/pluck.sh "$pkgdir/usr/share/doc/$pkgname/examples/pluck.sh"
	install -Dm644 "$srcdir"/home.html "$pkgdir/usr/share/doc/$pkgname/examples/home.html"
	install -Dm644 "$srcdir"/pluckerrc "$pkgdir/usr/share/doc/$pkgname/examples/pluckerrc"

	python3 -m installer -d "$pkgdir" .dist/*.whl
	install -Dm755 "$builddir"/bin/plucker-build "$pkgdir/usr/bin/plucker-build"
}

sha512sums="
00964ee5a9aea0e349e77ac071c124a36c1203b0d576bf93ffa73ce75ad1e620c7e93bc434c234a8f5f3e11177028c36fbbdb2ead9bde0ad1dc42f9d6870822f  PyPlucker-3.7.tar.gz
ab03054ab93289d7084c17946abc3c20ffce93b06d1dc9e488efdff27d50daad62ebea13f7cc471c9497c05e2001ad720c8baba24ceaedacc9f17ada201bd996  pluck.sh
9199442df5caee62a8f20897dad4390a2b61255dcfa4d45cc471686435a6437af869d0e23ad01395952512f78a838f16c4f4a16906cfbc4c32d7ded46cd08557  home.html
ebd4629a0d95313405e781d9db7e095e329fa0d63e8ae2a5c69c432b4394e59a79d137c0932444bd9cbed2efc53cbbbc96da2b3178187a45761d9a92370ec0bb  pluckerrc
078b68d6af9d57bbe786e3c9503ad821d67257bf38475d5d2e6ad582cff85429753d25f196107c76dc5e2e211754a4318b64bcd1df3d62ce66b919d64b7bfa6d  decode_python3.patch
5b05573ae12273e40475f9c7f72047f9aaa72862fa54bb0dbacfe2b1e0d823f7b80492f9fe0df1c6dfb9bea2030ee0a338f5cdebf8f1e3a6174d6c253d2ad688  correct_gettext.patch
"
